package com.edocbase.desktop.plugins.mdiary;

import java.util.List;

import com.edocbase.biz.diary.entities.SearchWord;
import com.edocbase.biz.diary.entities.SearchWordManager;
import com.edocbase.desktop.lightweight.widgets.swt.AbstractPopupContentProvider;

public class SearchWordContentProvider extends AbstractPopupContentProvider {

	@Override
	public Object[] getElements(Object inputElement) {
		if (inputElement instanceof List){
			List<SearchWord> wordList = SearchWordManager.getManager().listWords();
			String[] result = new String[wordList.size()];
			for (int i=0;i<wordList.size();i++){
				result[i] = wordList.get(i).getWord();
			}
			return result;
		}
		return new String[]{};
	}

}
